import { ElLoading } from "element-plus";

let loadingInstance: any;

function hideLoading() {
    loadingInstance.close();
}

function showLoading() {
    loadingInstance = ElLoading.service({
        lock: true, // 禁止滚动
        text: "数据加载中...", // 自定义加载提示文字
        background: "rgba(0, 0, 0, 0.2)", // 背景颜色
    });
}

export default {
    showLoading,
    hideLoading,
};